/**
 * Created by kevin on 16-1-18.
 */
Ext.define('cfWeb.store.util.AlertStore', {
    extend: 'Ext.data.Store',
    autoSync: true,
    autoLoad: true,
    alias: 'widget.alertStore',
    fields: [
        {name: 'appName', type: 'string'},
        {name: 'orgName', type: 'string'},
        {
            name: 'memory', type: 'string', convert: function (v, record) {
            console.log(v, '/', record);
            return v + '/' + record.raw.totMemory;
        }
        },
        {name: 'cpu', type: 'string'}
    ],
    data: {
        data: [
            {appName: 'wqnmlgb', orgName: 'org1', memory: '512M', cpu: '80%', totMemory: '1G'},
            {appName: 'wqnmlgb2', orgName: 'org2', memory: '512M', cpu: '80%', totMemory: '1G'},
            {appName: 'wqnmlgb3', orgName: 'org1', memory: '512M', cpu: '80%', totMemory: '1G'},
            {appName: 'wqnmlgb4', orgName: 'org5', memory: '512M', cpu: '80%', totMemory: '1G'},
            {appName: 'wqnmlgb5', orgName: 'org1', memory: '512M', cpu: '80%', totMemory: '1G'}
        ],
        success:true
    },
    proxy: {
        type: 'memory',
        reader:{
            type:'json',
            root:'data',
            successProperty : 'success'
        }
    }
});